package com.jxsd.edu.cn.tools;

import com.jxsd.edu.cn.struts2.models.PubMsgview;


//查询最新的物品记录ID
public class QueryNewlyPublishId 
{
    public  synchronized  static  int  getNewlyPublishId()
    {
    	String  sql="select  publishID  from  publishmessage  order  by  publishID  desc  limit  0,1";
    	Object[]  params=null;
    	ResultBean<PubMsgview>  hander=new  ResultBean<PubMsgview>();
    	PubMsgview  view=null;
    	try {
    		view=hander.handler(sql, params, PubMsgview.class);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	return view.getPublishID();
    }  
    
    
    public static  void  main(String[] args)
    {
    	System.out.println(getNewlyPublishId());
    }
}
